package com.auth.manage.plugin.domain.service;

import com.auth.manage.common.product.api.response.ProductInfo;
import com.auth.manage.plugin.domain.entity.Plugin;
import com.auth.manage.plugin.domain.entity.convertor.ProductConvertor;
import com.auth.manage.plugin.infr.mapper.ProductMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class ProductService extends ServiceImpl<ProductMapper, Plugin> {
    public ProductInfo getProductInfoByProductId(Long productId) {
        Plugin product = lambdaQuery()
                .eq(Plugin::getIdentifier, productId)
                .one();
        ProductInfo info = ProductConvertor.INSTANCE.do2VO(product);
        return info;
    }
}
